package wyu.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import wyu.service.PostReplyService;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/UP_relevancy")
public class PostReplyController {
    @Resource
    PostReplyService postReplyService;
    /*获取对应贴子的回复数*/
    @GetMapping("/replyNum")
    public Integer getReplyNum(@RequestParam("postId")int postId){
        return postReplyService.getReplyNum(postId);
    }
    /*根据回复数量返回帖子id列表供消费者使用*/
    @GetMapping("/orderByReplyNum")
    public List<Integer> orderByReplyNum(){
        return postReplyService.orderByReplyNum();
    }
}
